package main

import (
	"github.com/urfave/cli"
	"httpstunnel"
	"log"
	"os"
)

var (
	app = cli.NewApp()
)

func init() {

	app.Flags = []cli.Flag{
		cli.StringFlag{
			Name:        "addr,a",
			Usage:       "listen addr",
			Value:       "0.0.0.0",
			Destination: nil,
		},
		cli.StringFlag{
			Name:  "port,p",
			Usage: "listen port",
			Value: "443",
		},
		cli.StringFlag{
			Name:   "domain,d",
			Usage:  "domains",
			EnvVar: "",
			Hidden: false,
		},
		cli.StringFlag{
			Name:  "tcp",
			Usage: "prody address, for client registry",
			Value: "0.0.0.0:8080",
		},
	}

	app.Action = httpstunnel.Run
}

func main() {
	err := app.Run(os.Args)
	if err != nil {
		log.Fatal(err)
	}
}
